(function ($) {
    $.fn.simpleTree = function (options) {
        var that = $(this);
        var onClick = options.onClick;
        var initData = options.initData;
        var showIcon = options.showIcon;
        if(!showIcon){
            showIcon=false;
        }
        var setting = {
            data: {
                simpleData: {
                    enable: true
                }
            }, callback: {
                onClick: onClick
            }, view: {
                showIcon: showIcon
            }
        };

        if(options.check){
            if(options.check == "radio"){
                setting.check = {
                    enable: true,
                    chkStyle: "radio",
                    radioType: "all"
                }
            }else if(options.check == "checkbox"){
                setting.check = {
                    enable: true,
                    chkStyle: "checkbox",
                    radioType: "all"
                }
            }
        }


        zTree = $.fn.zTree.init(that, setting, initData);
        return zTree;
    }
})(jQuery);